package routers

import (
	"NovelBook/controller/superuser"
	"NovelBook/utils/auth"

	"github.com/gin-gonic/gin"
)

func SetSuperUserRouter(r *gin.Engine) {

	// 注册--暂时不需要注册Superuser
	r.POST(baseUrl + superuserUrl + "/register")

	// 账户登录
	r.POST(baseUrl+superuserUrl+"/login-account", superuser.LoginByAccount)

	// 邮箱登录
	r.POST(baseUrl+superuserUrl+"/login-email", superuser.LoginByEmail)

	r.POST(baseUrl+superuserUrl+"/reset-password", superuser.ResetPassword)

	// any other manager API you need

	super := r.Group(baseUrl + superuserUrl)
	super.Use(auth.JWTAuthSuperUser())
	{
		// 修改昵称或者头像
		super.PUT("user", superuser.Modify)
		r.GET("/test")
		// 吞吐量
		super.GET("/page-view", superuser.GetThroughput)
	}
}
